home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_09_11 / 9n11118a < prev    next >
Text File  |  1991-10-07  |  791b  |  31 lines

  1. Listing 3
  2.  
  3.    struct s_compare find_min_max(one, two, three);
  4.    int one, two, three;  /* Input values to compare */
  5.        {
  6.        struct s_compare compare;
  7.        {
  8.        if (one > two)
  9.            {
  10.            if (one > three)
  11.                compare.maximum = one;
  12.            else
  13.                compare.maximum = three;
  14.            if (two > three)
  15.                compare.minimum = three;
  16.            else
  17.                compare.minimum = two;
  18.        else
  19.            {
  20.            if (two > three)
  21.                compare.maximum = two;
  22.            else
  23.                compare.maximum = three;
  24.            if (one > three)
  25.                compare.minimum = three;
  26.            else
  27.                compare.minimum = one;
  28.            }
  29.        return compare;
  30.        }
  31.